
from datetime import datetime

from comm.sqlalchemyConfig import db


class BaseModel(db.Model):
    __abstract__ = True

    create_user = db.Column(db.String(50), nullable=True)
    create_time = db.Column(db.DateTime, default=datetime.now, nullable=True)
    update_user = db.Column(db.String(50), nullable=True)
    update_time = db.Column(db.DateTime, default=datetime.now, onupdate=datetime.now, nullable=True)
    lessees_id = db.Column(db.String(100), db.ForeignKey('tx_lessees.id'), doc='归属租户')